home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / netprog.zip / NETPROG.TAR / tftp / Makefile < prev    next >
Makefile  |  1989-12-17  |  4KB  |  161 lines

  1. #
  2. # Makefile for tftp client and server
  3. #
  4. #    This Makefile uses the files "make.client" and "make.server"
  5. #    to remember whether the client or server was last made.
  6. #    This way, you might not have to recompile everything each time.
  7. #    However, when switching from the client to the server, or vice-versa,
  8. #    you have to remake everything, since there are #ifdef's in each C
  9. #    file for the client or server.  The resulting object files can't
  10. #    be reused from the client to the server, or vice-versa.
  11. #
  12.  
  13. CFLAGS    = -O
  14. LIBS    =
  15. MYLIB    = ../libnet.a
  16.  
  17. CMDOBJ    = cmd.o cmdgetput.o cmdsubr.o    # only the clients process commands
  18. CMDSRC    = cmd.c cmdgetput.c cmdsubr.c
  19.  
  20. CLIOBJ    = error.o file.o fsm.o initvars.o \
  21.       maincli.o sendrecv.o $(CMDOBJ)
  22. CLISRC    = error.c file.c fsm.c initvars.c \
  23.       maincli.c sendrecv.c $(CMDSRC)
  24.  
  25. SRVOBJ    = error.o file.o fsm.o initvars.o \
  26.       mainserv.o sendrecv.o
  27. SRVSRC    = error.c file.c fsm.c initvars.c \
  28.       mainserv.c sendrecv.c
  29.  
  30. all:
  31.     make `systype.sh`udpclient
  32.     make `systype.sh`udpserver
  33.  
  34. udp:
  35.     make `systype.sh`udpclient
  36.     make `systype.sh`udpserver
  37.  
  38. tcp:
  39.     make `systype.sh`tcpclient
  40.     make `systype.sh`tcpserver
  41.  
  42. udpclient:
  43.     make `systype.sh`udpclient
  44.  
  45. udpserver:
  46.     make `systype.sh`udpserver
  47.  
  48. tcpclient:
  49.     make `systype.sh`tcpclient
  50.  
  51. tcpserver:
  52.     make `systype.sh`tcpserver
  53.  
  54. bsdudpclient:
  55.     -@if [ -r make.server ] ; \
  56.     then \
  57.         rm -f $(CLIOBJ) netudp.o make.server ; \
  58.     else \
  59.         true ; \
  60.     fi
  61.     @touch make.client
  62.     @make "CFLAGS=-O -DCLIENT -DDATAGRAM" \
  63.         "NETOBJ=netudp.o" "LIBS = " cli_tftp
  64.  
  65. bsdudpserver:
  66.     -@if [ -r make.client ] ; \
  67.     then \
  68.         rm -f $(SRVOBJ) netudp.o make.client ; \
  69.     else \
  70.         true ; \
  71.     fi
  72.     @touch make.server
  73.     @make "CFLAGS=-O -DSERVER -DDATAGRAM" \
  74.         "NETOBJ=netudp.o" "LIBS = " srv_tftp
  75.  
  76. bsdtcpclient:
  77.     -@if [ -r make.server ] ; \
  78.     then \
  79.         rm -f $(CLIOBJ) nettcp.o make.server ; \
  80.     else \
  81.         true ; \
  82.     fi
  83.     @touch make.client
  84.     @make "CFLAGS=-O -DCLIENT" \
  85.         "NETOBJ=nettcp.o" "LIBS = " cli_tftp
  86.  
  87. bsdtcpserver:
  88.     -@if [ -r make.client ] ; \
  89.     then \
  90.         rm -f $(SRVOBJ) nettcp.o make.client ; \
  91.     else \
  92.         true ; \
  93.     fi
  94.     @touch make.server
  95.     @make "CFLAGS=-O -DSERVER" \
  96.         "NETOBJ=nettcp.o" "LIBS = " srv_tftp
  97.  
  98. sys5udpclient:
  99.     -@if [ -r make.server ] ; \
  100.     then \
  101.         rm -f $(CLIOBJ) netudp.o make.server ; \
  102.     else \
  103.         true ; \
  104.     fi
  105.     @touch make.client
  106.     @make "CFLAGS = -O -DCLIENT -DDATAGRAM -I/usr/netinclude" \
  107.         "NETOBJ=netudp.o" "LIBS = -lnet -lnsl_s" cli_tftp
  108.  
  109. sys5udpserver:
  110.     -@if [ -r make.client ] ; \
  111.     then \
  112.         rm -f $(SRVOBJ) netudp.o make.client ; \
  113.     else \
  114.         true ; \
  115.     fi
  116.     @touch make.server
  117.     @make "CFLAGS = -O -DSERVER -DDATAGRAM -I/usr/netinclude" \
  118.         "NETOBJ=netudp.o" "LIBS = -lnet -lnsl_s" srv_tftp
  119.  
  120. xenixudpclient:
  121.     -@if [ -r make.server ] ; \
  122.     then \
  123.         rm -f $(CLIOBJ) netudp.o make.server ; \
  124.     else \
  125.         true ; \
  126.     fi
  127.     @touch make.client
  128.     @make "CFLAGS = -O -DCLIENT -DDATAGRAM -Ml -I/usr/include/exos" \
  129.         "NETOBJ=netudp.o" "LIBS = -lsocket" cli_tftp
  130.  
  131. xenixudpserver:
  132.     -@if [ -r make.client ] ; \
  133.     then \
  134.         rm -f $(SRVOBJ) netudp.o make.client ; \
  135.     else \
  136.         true ; \
  137.     fi
  138.     @touch make.server
  139.     @make "CFLAGS = -O -DSERVER -DDATAGRAM -Ml -I/usr/include/exos" \
  140.         "NETOBJ=netudp.o" "LIBS = -lsocket" srv_tftp
  141.  
  142. cli_tftp: $(CLIOBJ) $(NETOBJ) $(MYLIB)
  143.       cc -o tftp $(CFLAGS) $(CLIOBJ) $(NETOBJ) $(MYLIB) $(LIBS)
  144.  
  145. srv_tftp: $(SRVOBJ) $(NETOBJ) $(MYLIB)
  146.       cc -o tftpserv $(CFLAGS) $(SRVOBJ) $(NETOBJ) $(MYLIB) $(LIBS)
  147.  
  148. $(CLIOBJ): defs.h
  149. $(SRVOBJ): defs.h
  150. $(CMDOBJ): cmd.h
  151.  
  152. clean:
  153.     rm -f *.o tftp tftpserv *.out temp.* make.* Make.* core
  154.  
  155. print:    clean
  156.     print *.h *.c
  157.  
  158. lint:
  159.     lint -DCLIENT -bhx $(CLISRC) >  lint.out
  160.     lint -DSERVER -bhx $(SRVSRC) >> lint.out
  161.